import { ResponseBody } from "./ResponseBody";


export class Response{

    public statusCode: Number;
    public success: Boolean;
    public body: ResponseBody;
    public responseUrl: string;

    constructor(xhr: XMLHttpRequest){
        this.statusCode = xhr.status;
        this.success = xhr.status==200 ? true : false;
        this.body = new ResponseBody(xhr.responseText);
        this.responseUrl = xhr.responseURL;
    }
}